<template>
  <p>我是子组件1</p>
  <p :class="$attrs.class">我是子组件2</p>
</template>

<script setup>
  import { onMounted, ref } from "vue";
</script>

<style lang="scss" scoped>
  .active {
    color: red;
  }
</style>